<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>文件管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/sysAttachfile/">文件列表</a></li>
		<shiro:hasPermission name="sys:sysAttachfile:edit"><li><a href="${ctx}/sys/sysAttachfile/form">文件添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="sysAttachfile" action="${ctx}/sys/sysAttachfile/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>类型：</label>  
				<form:select path="attachtype" class="input-medium">
					<form:option value=" " label=" "/>
					<form:options items="${fns:getDictList('attach_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>创建人：</label>
				<sys:treeselect id="createBy" name="createBy.id" value="${recommend.createBy.id}" labelName="user.name" labelValue="${recommend.createBy.name}"
					title="学生" url="/sys/office/treeData?type=3" cssClass="input-small" isAll="true" allowClear="true" notAllowSelectParent="true"/>
			</li>

			<li><label>标签类型：</label>  
				<form:select path="lable_search" class="input-medium">
				    <form:option value="" label="选择标签"/>
					<form:option value="个人陈述" label="个人陈述"/>
					<form:option value="成绩单" label="成绩单"/>
					<form:option value="推荐信" label="推荐信"/>
					<form:option value="证书" label="证书"/>
					<form:option value="作品集" label="作品集"/>
					<form:option value="在读证明" label="在读证明"/>
					<form:option value="毕业证" label="毕业证"/>
					<form:option value="学位证" label="学位证"/>
					<form:option value="语言成绩" label="语言成绩"/>
					<form:option value="其他" label="其他"/>
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>文件名</th>
				<!-- <th>文件路径</th> -->
				<th>文件大小</th>
				<th>类型</th>
				<!-- <th>更新时间</th> -->
				<th>创建人</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="sysAttachfile">
			<tr>
				<td><a href="${ctx}/sys/sysAttachfile/form?id=${sysAttachfile.id}">
					${sysAttachfile.filename}
				</a></td>
				<!-- 
				<td>
					${sysAttachfile.filepath}
				</td>
				 -->
				<td>
					<fmt:formatNumber value="${sysAttachfile.filesize/1024}" pattern="#,###.##" />KB
				</td>
				<!-- 
				<td>
					<fmt:formatDate value="${sysAttachfile.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				 -->
				<td>
					${fns:getDictLabel(sysAttachfile.attachtype, 'attach_type', '')}
				</td>
				<!-- 
				<td>
					${sysAttachfile.remarks}
				</td>
				 -->
				 <td>${sysAttachfile.createBy.name}</td>
				<td>
					<a target="_blank" href="${sysAttachfile.filepath}">下载</a>
					<shiro:hasPermission name="sys:sysAttachfile:edit">
					
    				<a href="${ctx}/sys/sysAttachfile/form?id=${sysAttachfile.id}">修改</a>
					<a href="${ctx}/sys/sysAttachfile/delete?id=${sysAttachfile.id}" onclick="return confirmx('确认要删除该附件吗？', this.href)">删除</a>
					</shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>